export default function (global, console) {
  global.showQS = function () {
    if (location.search) {
      const querystring = location.search.slice(1).split('&')
      const qsTable = querystring.map((qs) => ({
        Key: qs.split('=')[0],
        Value: qs.split('=')[1],
        'Pretty Value': decodeURIComponent(qs.split('=')[1]).replace(/\+/g, ' '),
      }))

      console.group('QS')
      console.log(querystring.map((qs) => qs.replace('=', ': ')).join('\n'))
      console.table(qsTable)
      console.groupEnd('QS')
    } else {
      console.log('no querystring.')
    }
  }
}
